package com.walter.springai.tools;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.chat.model.ToolContext;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;

/**
 * 获取制定地区的天气
 */
@Slf4j
public class WeatherTool {

    /**
     *
     */
    @Tool(name = "getWeather", description = "获取天气信息")
    public String getWeather(@ToolParam(description = "位置信息", required = true) String location,
                             ToolContext toolContext) {
        log.info("location: {}", location);
        return "今天30度";
    }
}
